# CMake 最低版本号要求
cmake_minimum_required (VERSION 2.8)

project(ArmPolaris)

set(CMAKE_CXX_STANDARD 11)


# 交叉编译 --- 设置编译器和目标平台
set(CMAKE_CXX_COMPILER "arm-linux-g++")
set(CMAKE_C_COMPILER "arm-linux-gcc")


# 执行Shell命令，结果存于 GIT_VERSION_OUTPUT 变量中
# execute_process(COMMAND git rev-parse HEAD OUTPUT_VARIABLE GIT_VERSION_OUTPUT)
execute_process(COMMAND git rev-parse HEAD OUTPUT_VARIABLE GIT_VERSION_OUTPUT RESULT_VARIABLE COMMAND_RESULT)

add_subdirectory(Log)

# Include
include_directories(NetworkHttpCmd  3rd/CJson SystemTools Common)
include_directories(Log/Client)
include_directories(Log/Common)



# Source
aux_source_directory(. SRC_LIST)
aux_source_directory(3rd/CJson SRC_LIST)
aux_source_directory(NetworkHttpCmd SRC_LIST)
aux_source_directory(SystemTools SRC_LIST)
aux_source_directory(Common SRC_LIST)
aux_source_directory(6818Fundamental SRC_LIST)
aux_source_directory(OtherTools/AlsaTools SRC_LIST)


add_executable(ArmPolaris ${SRC_LIST})


# 使用CMAKE_CURRENT_SOURCE_DIR变量，获取当前路径
link_directories(${CMAKE_CURRENT_SOURCE_DIR}/Log/Client)
target_link_libraries(ArmPolaris  LogClientLib)
# target_link_libraries(ArmPolaris ${CMAKE_CURRENT_SOURCE_DIR}/Log/Client/libLogClient.a)

# 链接线程库
find_package(Threads)
target_link_libraries(ArmPolaris ${CMAKE_THREAD_LIBS_INIT})

# ================= for alsa =================
# =================   Start  =================
include_directories(OtherTools/AlsaTools)
include_directories(/home/ljh/MyStudy/ArmLib/alsa1.0.22Lib/include/)


target_link_libraries(ArmPolaris /home/ljh/MyStudy/ArmLib/alsa1.0.22Lib/lib/libasound.so)
# =================    End    =================


# ================= for jpeg =================
# =================   Start  =================
include_directories(6818Fundamental)
include_directories(/home/ljh/jpeg/include/)


target_link_libraries(ArmPolaris /home/ljh/jpeg/lib/libjpeg.so)
target_link_libraries(ArmPolaris /home/ljh/jpeg/lib/libjpeg.so.9)
target_link_libraries(ArmPolaris /home/ljh/jpeg/lib/libjpeg.so.9.3.0)
# =================    End    =================

